#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include "Vector.h"

void workWithVectors() {
	std::cout << "=============================VECTOR CALCULATOR=============================" << std::endl;
	std::cout << "Enter 1 - to add two vectors, 2 - to subtract two vectors"					   << std::endl;
	std::cout << "3 - to multiplied vector by vector, 4 - to multiplied vector by number"      << std::endl;
	std::cout << "0 - to exit"																   << std::endl;
	std::cout << "===========================================================================" << std::endl;

	int workWithVectorsMode;
	std::cin >> workWithVectorsMode;

	switch( workWithVectorsMode )
	{
	
	case 0:
			return;
			break;
	case 1:
		{	
			std::cout << "===========================ADDION OF TWO VECTORS===========================" << std::endl;

			std::cout << "Enter dimention of first vector: N = ";
			size_t firstDimension;
			std::cin >> firstDimension;
			std::cout << "Enter first vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector firstVector(firstDimension);
			std::cin >> firstVector;

			std::cout << "Enter dimention of second vector: N = ";
			size_t secondDimension;
			std::cin >> secondDimension;
			std::cout << "Enter second vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector secondVector (secondDimension);
			std::cin >> secondVector;
			
			std::cout << "RESULT:" << firstVector + secondVector << std::endl;
		}
		break;
		
	case 2:
		{
			std::cout << "=======================SUBSTRUCTION VECTOR BY VECTOR========================" << std::endl;

			std::cout << "Enter dimention of first vector: N = ";
			size_t firstDimension;
			std::cin >> firstDimension;
			std::cout << "Enter first vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector firstVector(firstDimension);
			std::cin >> firstVector;

			std::cout << "Enter dimention of second vector: N = ";
			size_t secondDimension;
			std::cin >> secondDimension;
			std::cout << "Enter second vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector secondVector (secondDimension);
			std::cin >> secondVector;

			std::cout << "RESULT:" << firstVector - secondVector;
		}
		break;

	case 3:
		{
			std::cout << "=======================MULTIPLITION VECTOR BY NUMBER======================" << std::endl;

			std::cout << "Enter dimention of first vector: N = ";
			size_t firstDimension;
			std::cin >> firstDimension;
			std::cout << "Enter first vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector firstVector(firstDimension);
			std::cin >> firstVector;

			std::cout << "Enter dimention of second vector: N = ";
			size_t secondDimension;
			std::cin >> secondDimension;
			std::cout << "Enter second vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector secondVector (secondDimension);
			std::cin >> secondVector;

			std::cout << "RESULT:" << firstVector * secondVector;
		}
		break;

	case 4:
		{
			std::cout << "=======================MULTIPLITION VECTOR BY VECTOR======================" << std::endl;

			std::cout << "Enter dimention of first vector: N = ";
			size_t dimension;
			std::cin >> dimension;
			std::cout << "Enter first vector in format: {1, 2, 3, ... N }" << std::endl;
			Vector firstVector(dimension);
			std::cin >> firstVector;

			std::cout << "Enter muber for multiplition: n = ";
			double number;
			std::cin >> number;

			std::cout << "RESULT:" << firstVector * number;
		}
		break;

	default:
		throw std::logic_error("MESSAGE: Incorrect value");
		break;

	}
}

